'''
Created on 22  2012

@author: Dave
'''
from search.algorithm import Heuristic
from osm_utils4 import CountryMap
class ShortestH (Heuristic):
    def evaluate(self, problem_state):
        '''
        Gives a score or cost for the given Problem state.
        
        @param problem_state: The Problem state to evaluate.
        @return: The score of the given state.
        '''
        ps = problem_state
        return ps.map.JunctionDistance(ps.junctionKey,ps.targetKey)
    
class FastestH (Heuristic):
    def evaluate(self, problem_state):
        '''
        Gives a score or cost for the given Problem state.
        
        @param problem_state: The Problem state to evaluate.
        @return: The score of the given state.
        '''
        ps = problem_state
        return ps.map.JunctionDistance(ps.junctionKey,ps.targetKey)/120.0

class SavingH(Heuristic):
    def evaluate(self, problem_state):
        '''
        Gives a score or cost for the given Problem state.
        
        @param problem_state: The Problem state to evaluate.
        @return: The score of the given state.
        '''
        ps = problem_state
        return ps.map.JunctionDistance(ps.junctionKey,ps.targetKey)/20.0